package com.mingqijia.gassafety.webserver.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mingqijia.gassafety.db.entity.DeviceState;
import com.mingqijia.gassafety.db.entity.vo.ConsumerDeviceStatVO;
import com.mingqijia.gassafety.db.entity.vo.DeviceStateVO;
import com.mingqijia.gassafety.db.entity.vo.LatestLogListVO;
import com.mingqijia.gassafety.db.entity.vo.ScreenSmallBellItemVO;
import com.mingqijia.gassafety.db.entity.vo.ScreenSmallBellListReqVO;
import com.mingqijia.gassafety.shared.utils.commonUtils.PageUtil;
import com.mingqijia.gassafety.webserver.request.UpdateDeviceStateRequest;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 报警器设备状态更新表 服务类
 * </p>
 *
 * @author guoliang.lao
 * @since 2022-08-03
 */
public interface DeviceStateService extends IService<DeviceState> {

    /**
     * 查询实时设备和状态列表
     * @param params
     * @return
     */
    PageUtil<DeviceStateVO> getDeviceStateList(LatestLogListVO params);
    /**
     * 查询实时设备和状态列表 不分页
     * @param params
     * @return
     */
    List<DeviceStateVO> selectDeviceStateList(LatestLogListVO params);
    /**
     * 根据设备号查询实时状态
     * @param imei
     * @return
     */
    DeviceStateVO getDeviceStateByImei(String imei,String spId);
    /**
     * 根据spId查询实时状态汇总
     * @param spId
     * @return
     */
    List<Map<String,Object>> getDeviceStateSummary(String spId);

    List<Map<String,Object>> getDeviceStateSummaryBySpIds(List<String> spId,List<String> funcCodes);

    Map<String,DeviceState> getDeviceState(List<String> deviceIds, String spId);

    int updateDeviceState(UpdateDeviceStateRequest request, String spId);

    boolean updateDeviceStateList(List<UpdateDeviceStateRequest> request);

    Map<Integer,ConsumerDeviceStatVO> getConsumerDeviceState(List<String> spIds,List<Integer> consumerIds);

    PageUtil<ScreenSmallBellItemVO> getScreenSmallBellList(ScreenSmallBellListReqVO params);
}
